<div data-role="header" id="header" data-nobackbtn="true">
	<a data-icon="arrow-l" rel="external" href="<?php echo WEB_ROOT?>webmail/menu">Retour</a>
	<h1>Messages non-lus</h1>
</div><!-- /header -->

<div data-role="content" id="content">
	<ul class="list" id="maillist" data-role="listview" data-split-icon="gear" data-theme="c" data-split-theme="d">
		<?php foreach($emailsbymb as $mb): ?>
			<?php if(count($mb['emails']) != 0): ?>
			<li data-role="list-divider">
			<?php
				switch($mb['mailbox']->fullname) {
					case INBOX: echo 'Bo&icirc;te de r&eacute;ception'; break;
					case TRASH: echo 'Corbeille'; break;
					default: echo $mb['mailbox']->realname; break;
				}
			?>
			</li>
			<?php foreach($mb['emails'] as $email): ?>
			<li>
				<a id="a-<?php echo $email->uid; ?>" href="<?php echo WEB_ROOT; ?>webmail/view/<?php echo $mb['mailbox']->fullname; ?>/<?php echo $email->uid; ?>">
					<div>
						<div class="ui-btn-inner">
							<div class="ui-btn-text" style="padding:7px 30px 0 7px;">
								<h2 class="ui-li-heading" style="margin-top: 0px;" >
									<?php echo $email->from; ?>
								</h2>
								<p class="ui-li-desc"><strong><?php echo $email->subject; ?></strong></p>
								<p class="ui-li-desc"><?php echo date('d/m/Y H:i',strtotime($email->date)) ?></p>
							</div>
						</div>
					</div>
				</a>
			</li>
			<?php endforeach; ?>
			<?php endif; ?>
		<?php endforeach; ?>
		<?php if($count == 0): ?>
			<li>
				Aucun message
			</li>
		<?php endif; ?>
	</ul>
</div><!-- /content -->

<div data-role="footer" id="footer">
	<div style="float: left; margin-left: 20%">
		<a href="<?php echo WEB_ROOT; ?>compose/index" rel="external">
			<div style="width: 32px; height: 32px; line-height: 32px; text-align: center;">
				<img src="<?php echo WEB_ROOT; ?>assets/img/pencil-icon_big.png" alt="Ecrire" style="vertical-align: middle;" />
			</div>
		</a>
	</div>
	<div style="float: right; margin-right: 20%">
		<a id="deco" onClick="if(confirm('Voulez-vous vraiment vous déconnecter ?')){this.setAttribute('href', '<?php echo WEB_ROOT; ?>member/logout');}" rel="external">
			<div style="width: 32px; height: 32px; line-height: 32px; text-align: center;">
				<img src="<?php echo WEB_ROOT; ?>assets/img/logout.png" style="vertical-align: middle;" alt="Logout" />
			</div>
		</a>
	</div>
</div><!-- /footer -->

<style>
	.list .ui-li .ui-btn-inner { padding:0;}
</style>
